<script type="">
    $(document).ready(function()
    {
        $("#poll").submit(function()
        {
            getPollSubmit(document.poll.VOTE);
            return false;
        });
    });
</script>
<?php
    function __autoload($class_name)
	{
		include_once('classes/'.strtolower($class_name).'.php');
	}
    $binhchon = new binhchonbs();
    $binhchon->MaBinhChon = 1;
    $ret_binhchon = $binhchon->GetPollId();
?>
<?php
if(isset($_SESSION['BinhChon']))
{
    include_once "ketqua_binhchon_ajax.php";
}
else
{
?>
<form action="index.php?do=binhchon_submit" method="post" id="poll" name="poll" style="margin-bottom: 10px;">
    <?php
        echo "<h3>".$ret_binhchon[0]['TieuDe']."</h3>"; 
        $resOptions = $binhchon->GetPollOption();
        echo "<table style='margin-bottom: 10px;' boder='0'>";
		for($i = 0; $i < ($resOptions != false ? count($resOptions) : 0); $i++)
        {
			if($resOptions[$i]['DuocChon'])
                $checked="checked='checked'";
            else
                $checked = "";
            
            echo "<tr>";
            echo "<td style='padding-left: 15px;'>";
                echo "<input $checked type=\"radio\" value=\"".$resOptions[$i]['MaTuyChon']."\" name='VOTE[]' id='VOTE' />
                      <label style='padding-left: 3px; color: #fff;' for=\"pollerOption".$resOptions[$i]['MaTuyChon']."\" id=\"optionLabel".$resOptions[$i]['MaTuyChon']."\">
                      <span></span>".$resOptions[$i]['TenTuyChon']."</label>";
            echo "</td>";
            echo "</tr>";
		}
        echo "</table>";
    ?>
    <input class="button" type="submit" style="margin: 0 15px;" name="BinhChon" value="Bình chọn" />
    <a href="index.php?do=ketqua_binhchon" onclick="getPoll(); return false;"><input class="button" type="button" name="KetQua" value="Xem kết quả" /></a>
</form>
<?php
}
?>